package dao.impl;


import dao.ISessionAggrStatDAO;
import domain.SessionAggrStat;
import jdbc.JDBCHelper;

/**
 * session聚合统计DAO实现类
 * @author Administrator
 *
 */
public class SessionAggrStatDAOImpl implements ISessionAggrStatDAO {
	
	/**
	 * 插入session聚合统计结果
	 * @param sessionAggrStat 
	 */

	public void insert(SessionAggrStat sessionAggrStat) {
		String sql = "insert into session_aggr_stat "
				+ "values(?,?,?,?,?,?,?,?,?,?,?,?)";
		
		Object[] params = new Object[]{sessionAggrStat.getTaskid(),
				sessionAggrStat.getSession_count(),
				sessionAggrStat.getVisit_length_1s_20s_ratio(),
				sessionAggrStat.getVisit_length_21s_40s_ratio(),
				sessionAggrStat.getVisit_length_41s_60s_ratio(),
				sessionAggrStat.getVisit_length_61s_80s_ratio(),
				sessionAggrStat.getVisit_length_81s_100s_ratio(),
				sessionAggrStat.getVisit_length_101s_120s_ratio(),
				sessionAggrStat.getStep_length_1_2_ratio(),
				sessionAggrStat.getStep_length_3_4_ratio(),
				sessionAggrStat.getStep_length_5_6_ratio(),
				sessionAggrStat.getStep_length_7_8_ratio()};
		JDBCHelper jdbcHelper = JDBCHelper.getInstance();
		jdbcHelper.executeUpdate(sql, params);
	}

}
